package com.le.tester.onjava8.l1_2;

import java.util.stream.Stream;

/**
 * createTime：2022/10/20 15:00
 * description：重载enum中的toString()
 */
public enum SpaceShip {
    SCOUT, CARGO, TRANSPORT, CRUISER, BATTLESHIP, MOTHERSHIP;

    @Override
    public String toString() {
        String name = name();
        String lower = name.substring(1).toLowerCase();

        return name.charAt(0) + lower;
    }

    public static void main(String[] args) {
        Stream.of(values()).forEach(System.out::println);
    }
}
